# -*- mode: conf -*-

[Unit]
Description=Prometheus SNMP exporter.
Documentation=https://github.com/prometheus/snmp_exporter
After=network.target

[Service]
{% if ansible_processor_vcpus > 1 %}
Environment=GOMAXPROCS={{ (ansible_processor_vcpus * 0.5 + 1)|int }}
{% else %}
Environment=GOMAXPROCS=1
{% endif %}
EnvironmentFile=-/etc/default/snmp_exporter
User=prometheus
LimitNOFILE={{ prometheus_arg.ulimit_nofile }}
LimitNPROC={{ prometheus_arg.ulimit_nproc }}
LimitCORE={{ prometheus_arg.ulimit_core }}
LimitMEMLOCK={{ prometheus_arg.ulimit_memlock }}
ExecStart=/usr/bin/snmp_exporter $SNMP_EXPORTER_OPTS
Restart=always

[Install]
WantedBy=multi-user.target
